﻿// Nail framework
//
// Copyright © Frank Nagl, 2009
// admin@franknagl.de
// www.franknagl.de
//
namespace Nail
{
    using System.Drawing;
    using System.Drawing.Imaging;

    class Program
    {
        static void Main(string[] args)
        {
            float test = IOFile.ReadGermanFloatData("DepthDemo.txt", 2, '.');
            System.Console.WriteLine(test);
            System.Console.WriteLine();
            float[] data = IOFile.ReadFloatDataArray("DepthDemo.txt", 3, ';');
            System.Console.WriteLine(data);

            string s = IOFile.CDir("Test");
            System.Console.WriteLine(s);
            //Bitmap b = new Bitmap(5, 5, PixelFormat.Format32bppArgb);

            //b.SetPixel(0, 0, Color.Red);
            //b.SetPixel(1, 0, Color.Red);
            //b.SetPixel(2, 0, Color.Red);
            //b.SetPixel(3, 0, Color.Red);
            //b.SetPixel(4, 0, Color.Red);

            //b.SetPixel(0, 1, Color.Red);
            //b.SetPixel(1, 1, Color.Blue);
            //b.SetPixel(2, 1, Color.Red);
            //b.SetPixel(3, 1, Color.Red);
            //b.SetPixel(4, 1, Color.Red);

            //b.SetPixel(0, 2, Color.Red);
            //b.SetPixel(1, 2, Color.Red);
            //b.SetPixel(2, 2, Color.Blue);
            //b.SetPixel(3, 2, Color.Red);
            //b.SetPixel(4, 2, Color.Red);

            //b.SetPixel(0, 3, Color.Red);
            //b.SetPixel(1, 3, Color.Red);
            //b.SetPixel(2, 3, Color.Red);
            //b.SetPixel(3, 3, Color.Blue);
            //b.SetPixel(4, 3, Color.Red);

            //b.SetPixel(0, 4, Color.Red);
            //b.SetPixel(1, 4, Color.Red);
            //b.SetPixel(2, 4, Color.Red);
            //b.SetPixel(3, 4, Color.Red);
            //b.SetPixel(4, 4, Color.Red);

            //b.Save("redblue.bmp", ImageFormat.Bmp);

            //Bitmap bmp = new Bitmap("latte.jpg");
            //Bitmap bmp = new Bitmap("redblue.bmp");
            //Bitmap bmp = new Bitmap("test3.bmp");

            //RegionbasedColorSegmentation seg = new RegionbasedColorSegmentation(bmp, 5);

            //seg.ExtractSegments();
            //seg.GetSegmentedBitmap();
            //seg.SegmentedBitmap.Save("result.bmp", ImageFormat.Bmp);


            //Bitmap bmp = new Bitmap("00_1line.jpg");
            //Bitmap bmp = new Bitmap("00_sample8.jpg");
            //Bitmap bb = new GrayscaleBT709().Apply(bmp);
            //bb = new Threshold(200).Apply(bb);
            //HoughLineTransformation lineTransform = new HoughLineTransformation();
            //// apply Hough line transofrm
            //lineTransform.ProcessImage(bb);
            //Bitmap houghLineImage = lineTransform.ToBitmap();
            //houghLineImage.Save("00_hough_params.bmp", ImageFormat.Bmp);

            //Bitmap bmp = new Bitmap("feuer.jpg");
            //SimpleColorSegmentation cs = new SimpleColorSegmentation();
            //cs.Threshold = 90;//cs.Exponent = 7;

            //cs.ProcessImage(bmp);
            //bmp.Save("00_ColorSeg.bmp", ImageFormat.Bmp);

            //SimpleFloodFill flood = new SimpleFloodFill();
            //flood.ProcessImage(bmp);
            Stopwatch.Start();
            //SimpleColorSegmentation cs = new SimpleRegionSegmentation();
            ////SimpleRegionColorSegmentation cs = new SimpleRegionColorSegmentation();
            //cs.ProcessImage(bmp);
            //bmp.Save("00_FloodfillSeg.bmp", ImageFormat.Bmp);
            Stopwatch.End(false);
        }
    }
}
